#include "st_full_motion_blur.h"
st_full_motion_blur::st_full_motion_blur()
{

}

st_full_motion_blur::~st_full_motion_blur()
{

}

void st_full_motion_blur::init()
{
	D3DVERTEXELEMENT9*	_vertex_element=new D3DVERTEXELEMENT9[4];
	D3DVERTEXELEMENT9	motion_blur[]=
	{
		{ 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0 }, //size 12
		{ 0, 12, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_NORMAL, 0 }, //size 12
		{ 0, 24, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0 }, //size 8
		D3DDECL_END()
	};
	for(int i=0;i<4;++i)
	{
		_vertex_element[i]=motion_blur[i];
	}
	set_vertex_element(_vertex_element);
	set_vertex_size(sizeof(motion_blur));

}

void st_full_motion_blur::default_set_args( LTEffectShader *pEffect,const LTShaderDeviceState &ShaderDeviceState )
{
	/*
	LRESULT hr;
	hr = pEffect->SetTextureRT("m_curframtexture", (HRENDERTARGET)1);
	hr = pEffect->SetTextureRT("m_lastframtexture", (HRENDERTARGET)2);
	
	if(m_car_speed>120.0f)
		m_car_speed= 0.05f + (m_car_speed-120.0f)*0.001f;
	else
		m_car_speed = 0.0f;
	
	pEffect->SetFloat("SampleDist",m_car_speed);
	*/
	

}